#include "include.h"
#include "func.h"
#include "func_le_dut.h"

AT(.text.func.le_dut)
void func_le_dut_process(void)
{
    func_process();
}

AT(.text.func.le_dut)
static void func_le_dut_enter(void)
{
    sys_cb.bt_is_inited = 0;
    cfg_bt_work_mode = MODE_BQB_RF_BLE;
    huart_dut_init(HUART_TR_PB4, HUART_TR_PB3, 9600);
    bt_init();
    func_bt_init();
}

AT(.text.func.le_dut)
static void func_le_dut_exit(void)
{
    le_mic_discon_all();
    huart_dut_exit();
    bt_off();
    sys_cb.bt_is_inited = 0;
    func_cb.last = FUNC_LE_DUT;
    cfg_bt_work_mode = MODE_NORMAL;
    bt_init();
}

AT(.text.func.le_dut)
void func_le_dut(void)
{
    printf("%s\n", __func__);

    func_le_dut_enter();

    while (func_cb.sta == FUNC_LE_DUT) {
        func_le_dut_process();
        func_le_dut_message(msg_dequeue());
        //func_device_display();
    }

    func_le_dut_exit();
}

